﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:il="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions" 
    x:Class="ComboBUG.GamePage"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" 
    Orientation="Portrait" 
    BeginLayoutChanged="PhoneApplicationPage_BeginLayoutChanged" 
    shell:SystemTray.IsVisible="False"
    xmlns:MyExample="clr-namespace:ComboBUG" 
    xmlns:local="clr-namespace:ControlTiltEffect"
    local:TiltEffect.IsTiltEnabled="True"    
    >
    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="StoryboardAnimaPonto"/>
        <Storyboard x:Name="StoryboardGota" RepeatBehavior="1" AutoReverse="True" >
            <DoubleAnimation Duration="0" To="1.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="1.476" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="8" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="10" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-44.849"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="36.608"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardExplosao">
            <DoubleAnimation Duration="0:0:0.2" To="1.675" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <BackEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.2" To="1.619" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <BackEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.2" To="13.5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <BackEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimation Duration="0:0:0.2" To="13" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True">
                <DoubleAnimation.EasingFunction>
                    <BackEase EasingMode="EaseInOut"/>
                </DoubleAnimation.EasingFunction>
            </DoubleAnimation>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-66.405"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-146.259"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="-273.129"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="-372.666">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="StoryboardSplash">
            <DoubleAnimation Duration="0:0:0.2" To="1.452" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="9.5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="1.425" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0:0:0.2" To="8.5" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="image" d:IsOptimized="True"/>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="image">
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-37.51">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseIn"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
                <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="34.412">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseInOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Name="StoryboardMovimentaFundo"
                    RepeatBehavior="Forever"
                    AutoReverse="True">
            <DoubleAnimationUsingKeyFrames 
                Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" 
                Storyboard.TargetName="imgSourceFundo">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-14.999"/>
                <EasingDoubleKeyFrame KeyTime="0:0:5.9" Value="-318.452">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgSourceFundo">
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:5.9" Value="-77.98">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ExponentialEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>

        </Storyboard>
        <Style x:Key="ButtonStyle1" TargetType="Button">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="Padding" Value="10,3,10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ButtonBackground" d:IsOptimized="True"/>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{x:Null}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
                                <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Background="{StaticResource TransparentBrush}"/>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" 
          Background="Black">

        <Grid.RowDefinitions>
            <RowDefinition x:Name="LinhaTop" Height="0*" />
            <RowDefinition x:Name="LinhaMidle" Height="80*" />
            <RowDefinition x:Name="LinhaBottom" Height="20*" />
        </Grid.RowDefinitions>

        <Border x:Name="BorderWrapPanel" 
                CornerRadius="5" 
                Grid.Row="1" Width="Auto" BorderThickness="5" 
                BorderBrush="LightBlue" 
                Opacity="1" Margin="0,0,0,142" Grid.RowSpan="2">

            <toolkit:WrapPanel  
            x:Name="WrapPanelPrincipal"                 
            HorizontalAlignment="Left" 
			Margin="20" Height="Auto"
			VerticalAlignment="Top" 
            Orientation="Horizontal"   >

                <Custom:Interaction.Behaviors>
                    <il:FluidMoveBehavior AppliesTo="Children" Duration="00:00:01">
                        <il:FluidMoveBehavior.EaseY>
                            <BackEase EasingMode="EaseInOut" Amplitude="1"/>
                        </il:FluidMoveBehavior.EaseY>
                        <il:FluidMoveBehavior.EaseX>
                            <CubicEase EasingMode="EaseIn"/>
                        </il:FluidMoveBehavior.EaseX>
                    </il:FluidMoveBehavior>
                </Custom:Interaction.Behaviors>



            </toolkit:WrapPanel>

        </Border>
        
        <StackPanel Background="Black" 
                Grid.Row="0" 
                Margin="0">

            <Border x:Name="BordaFundo" CornerRadius="25" 
                    Background="Black"  
                    Height="Auto" 
                    Width="Auto" Margin="0" 
                    BorderThickness="1" 
                    BorderBrush="Black"  >

                <StackPanel x:Name="PainelFundo"
                    Margin="2" 
                    Orientation="Horizontal" 
                    Background="Transparent" />
            </Border>

        </StackPanel>


        <Grid x:Name="GridOptions" Margin="3" 
              Background="Transparent" Grid.Row="2">
            <Grid.RowDefinitions>
                <RowDefinition Height="42*" />
                <RowDefinition Height="49*" />
                <RowDefinition Height="63*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="113*" />
                <ColumnDefinition Width="53*" />
                <ColumnDefinition Width="308*" />
            </Grid.ColumnDefinitions>

            <MediaElement x:Name="beeper" Margin="5,0,5,5" Grid.ColumnSpan="3" Grid.RowSpan="3" Height="118" VerticalAlignment="Bottom" />

            <TextBlock Text="Points:" 
                       Foreground="WhiteSmoke" 
                       Margin="30,0,202,16" FontSize="26" 
                       Height="Auto" TextAlignment="Center"
                       Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" />


            <TextBlock Text="Level" 
                       Foreground="WhiteSmoke" 
                       TextAlignment="Center"
                       FontSize="24" Margin="0,31,10,42" Grid.Row="1" Grid.RowSpan="2" />
            <TextBlock x:Name="txtNivel" 
                       Text="1" 
                       Margin="-10,0,0,6" 
                       TextAlignment="Center"
                       FontSize="50" 
                       FontWeight="Bold" 
                       Foreground="Red" Grid.Row="2"                       
                       />
            
            <TextBlock x:Name="txtEspecial" 
                       Margin="7,14,7,0" 
                       Text="COMBO BUG" 
                       FontSize="18" 
                       FontWeight="Bold" Width="Auto" 
                       Foreground="#FFFCFEFF" 
                       TextAlignment="Center"
                       Grid.ColumnSpan="3" />

            
            <TextBlock 
                x:Name="txtPontos" 
                Text="000000" 
                FontSize="60" 
                Foreground="White"  
                Margin="0,23,23,0" 
                TextAlignment="Right"                                 
                FontFamily="Segoe WP" 
            
                Grid.Column="2" 
                Grid.Row="1" 
                VerticalAlignment="Top" Height="73" Grid.RowSpan="2" />



            <Button FontFamily="Calibri" 
                    Content="Restart" 
                    Grid.Column="2" 
                    Grid.RowSpan="2" 
                    Height="71" 
                    HorizontalAlignment="Left" 
                    Margin="175,14,0,0" 
                    Name="btRestart" 
                    VerticalAlignment="Top" 
                    Width="146" 
                     BorderBrush="White" 
                    Foreground="White"/>
        </Grid>





    </Grid>


</phone:PhoneApplicationPage>